package com.bstek.demo.entity;

import java.util.Set;

/**
 * Dept实体类
 * @author lemon
 *
 */
public class Dept {

	/**
	 * 部门id
	 */
	private Integer deptid;
	/**
	 * 部门名称
	 */
	private String deptname;
	/**
	 * 父部门id
	 */
	private Integer pid;
	
	/**
	 * 子部门集合
	 */
	private Set<Dept> deptSet;

	public Integer getDeptid() {
		return deptid;
	}

	public void setDeptid(Integer deptid) {
		this.deptid = deptid;
	}

	public String getDeptname() {
		return deptname;
	}

	public void setDeptname(String deptname) {
		this.deptname = deptname;
	}

	public Integer getPid() {
		return pid;
	}

	public void setPid(Integer pid) {
		this.pid = pid;
	}

	public Set<Dept> getDeptSet() {
		return deptSet;
	}

	public void setDeptSet(Set<Dept> deptSet) {
		this.deptSet = deptSet;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((deptSet == null) ? 0 : deptSet.hashCode());
		result = prime * result + ((deptid == null) ? 0 : deptid.hashCode());
		result = prime * result + ((deptname == null) ? 0 : deptname.hashCode());
		result = prime * result + ((pid == null) ? 0 : pid.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Dept other = (Dept) obj;
		if (deptSet == null) {
			if (other.deptSet != null)
				return false;
		} else if (!deptSet.equals(other.deptSet))
			return false;
		if (deptid == null) {
			if (other.deptid != null)
				return false;
		} else if (!deptid.equals(other.deptid))
			return false;
		if (deptname == null) {
			if (other.deptname != null)
				return false;
		} else if (!deptname.equals(other.deptname))
			return false;
		if (pid == null) {
			if (other.pid != null)
				return false;
		} else if (!pid.equals(other.pid))
			return false;
		return true;
	}

	
	
	
	
	
	
}
